package fr.inserm.umr915.vcfannotator.annotators;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import fr.inserm.umr915.libjson.NodeFactory;
import fr.inserm.umr915.libjson.bdb.NodeBinding;
import fr.inserm.umr915.vcfannotator.Annotator;
import fr.inserm.umr915.vcfannotator.BaseDatabase;


public abstract class AbstractAnnotator implements Annotator
	{
	protected static final Log LOG = LogFactory.getLog("vcf.annotator"); 
	private String name;
	private String description;
	protected NodeFactory nodeFactory=null;
	protected NodeBinding nodeBinding=null;
	protected BaseDatabase baseDatabase=null;
	
	protected AbstractAnnotator()
		{
		this.nodeFactory=new NodeFactory();
		this.nodeBinding=new NodeBinding(this.nodeFactory);
		}
	

	@Override
	public String getDescription()
		{
		return description==null?getName():this.description;
		}

	public void setDescription(String description) {
		this.description = description;
		}
	
	public void setName(String name)
		{
		this.name = name;
		}
	
	@Override
	public String getName()
		{
		return this.name;
		}
	
	@Override
	public void init(BaseDatabase baseDatabase)
		{
		this.baseDatabase=baseDatabase;
		}
	
	@Override
	public void cleanup()
		{
		this.baseDatabase=null;
		}
	
	}
